<?php

namespace App\Http\Controllers\Home;

use App\Http\Controllers\Controller;
use App\Services\ChatService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;

class ChatListController extends Controller{
    public $request;
    public $ChatService;

    public function __construct(Request $request, ChatService $ChatService){
        $this->request = $request;
        $this->ChatService = $ChatService;
    }

    //聊天室
    public function index(){
        $fromid = $_GET['fromid'];
        return view("home.chat.list")->with('fromid',$fromid);
    }

    public function get_list(){
        $data       = $this->request->all();
        $fromid = $data['id'];
        $info  = DB::table('chat_communication')->groupBy('fromid')->having('fromid','>',1)->get();
//        $info  = DB::table('chat_communication')->select('fromid','toid','fromname')->where('toid',$fromid)->groupBy('fromid')->get();
//        $users = DB::table('users')
//            ->groupBy('account_id')
//            ->having('account_id', '>', 100)
//            ->get();
        var_dump($info);exit;
    }





}

